
           var slideBoxNode = Q.one('.focus_img'),
               width = slideBoxNode.width(), //窗口宽度
               n =slideBoxNode.children().length,
               pause = false,    //窗口个数
               lock = false,
               duration = 1; //持续时间 （秒）
               delayTime = 3000, // 延迟时间 (毫秒)
               currentIndex =0;


            slideBoxNode.html(slideBoxNode.html()+slideBoxNode.html());
            slideBoxNode.width(2*n*width);


            var timeHandler = 0;
            function _run() {
                if(lock) return false;
                lock = true;
                var marginLeft  = parseInt(slideBoxNode.css('margin-left'));
                if(marginLeft<=-width*(2*n-2)) {
                    slideBoxNode.css('margin-left', -width+'px');
                    marginLeft =  -width;
                }
                var step =  pause == true ? marginLeft : marginLeft-width;
                slideBoxNode.animate({'margin-left' : step}, duration, null, function() {
                     currentIndex = -step/width;
                    console.info(currentIndex);
                    _afterSlide(currentIndex >=n ? currentIndex-n :currentIndex);
                    lock = false;

                });
            }
            timeHandler = setInterval(_run, delayTime);
            //为slide窗口绑定mouseover事件
            Q.all('.focus_img').on('mouseover', function(){
                pause = true;
            }).on('mouseout', function(){
                pause = false;
            });
            //为trigger 绑定click事件
            Q.all('.img_num a').on('click', function(e){
                if(lock) return false;
                lock = true;
                clearTimeout(timeHandler);
                slideBoxNode.stop(1);

                var currentIndex = (parseInt(this.innerHTML)>=3 ? 2: parseInt(this.innerHTML)+2);

                var targetMargin = -currentIndex*width; //这里通过innerHTML来获取序号，不好
                slideBoxNode.animate({'margin-left':targetMargin}, duration, null, function(){

                    _afterSlide(currentIndex >=n ? currentIndex-n :currentIndex);
                    lock = false;
                    timeHandler = setInterval(_run, delayTime);
                });

            });

            function _afterSlide(i) {
                Q.all('.img_num a').removeClass('hover').item(i).addClass('hover');
                Q.all('.cur_title').html(slideBoxNode.children().item(i).attr('data-title'));
            }